import { App as AntdApp, message } from 'antd';
import { Helmet } from 'react-helmet-async';

import { setMessageApi } from '@/hooks/use-message/messageApi';
import Router from '@/router/index';
import AntdConfig from '@/theme/antd';

import { MotionLazy } from './components/animate/motion-lazy';

function App() {
  const [messageApi, contextHolder] = message.useMessage();
  setMessageApi(messageApi);

  return (
    // <StyleProvider layer>
    <AntdConfig>
      <AntdApp>
        {contextHolder}
        <MotionLazy>
          <Helmet>
            <title>天工睿核智能体</title>
            <link rel="icon" href="/faviicon-eai.ico" />
          </Helmet>
          <Router />
        </MotionLazy>
      </AntdApp>
    </AntdConfig>
    // </StyleProvider>
  );
}

export default App;
